$(document).ready(function(){

	var time = new Date();
	time.setHours(parseInt(time.getHours()) + 2);
	
    function freshtime(time){
		
	    var endtime = time;
	    var nowtime = new Date();
	    var str = str = "考试时间已用尽";
	    
	    var t = parseInt((endtime.getTime() - nowtime.getTime()) / 1000);
	    
	    var h = 0;
	    var m = 0;
	    var s = 0;
	    
	    if(t > 0){
	    	
	        h = Math.floor(t / 3600 % 24);
	        m = Math.floor(t / 60 % 60);
	        s = Math.floor(t % 60);
	        var str = (h < 10?"0" + h : h) + "时 : " + (m < 10?"0" + m : m) + "分 : " + (s < 10?"0" + s : s) + "秒 "

	    } else {
	    	clearInterval(interv);
	    }
	    
	    $("#time").html(str);
	    
	}
	
    var interv = setInterval(function(){freshtime(time);}, 50);

});